/***
 * @description 登录验证中间件
 * @author zhang
 */

const { ErrMess } = require("../res-message/index");

const userVerify = async (ctx,next) => {
    const session = ctx.session
    if (session && session.userInfo) {
        await next()
        return
    }

    ctx.body = new ErrMess(10003, '请登录')
}

module.exports = {
    userVerify
}